/*
 * AttributeCondition.h
 *
 *  Created on: 2010-8-28
 *      Author: Xairy
 */

#ifndef ATTRIBUTECONDITION_H_
#define ATTRIBUTECONDITION_H_

#include "Condition.h"
#include "CSSException.h"
#include <string>

using std::string;

class AttributeCondition : public Condition
{
public:
	virtual const string* getNameSpaceURI()const = 0;
	virtual const string* getLocalName()const = 0;
	virtual bool getSpecified()const = 0;
	virtual const string* getValue()const = 0;
};

class CombinatorCondition : public Condition
{
public:
	virtual const Condition& getFirstCondition()const = 0;
	virtual const Condition& getSecondCondition()const = 0;
};

class ContentCondition : public Condition
{
public:
	virtual const string* getData()const = 0;
};

class LangCondition : public Condition
{
public:
	virtual const string* getLang()const = 0;
};

class NegativeCondition : public Condition
{
public:
	virtual const Condition& getCondition()const = 0;
};

class PositionalCondition : public Condition
{
public:
	virtual int getPosition()const = 0;
	virtual bool getTypeNode()const = 0;
	virtual bool getType()const = 0;
};

class ConditionFactory
{
public:
	virtual CombinatorCondition* createAndCondition(Condition* First,
			                       Condition* Second)throw(CSSException) = 0;

	virtual CombinatorCondition* createOrCondition(Condition* First,
			                       Condition* Second)throw(CSSException) = 0;

	virtual NegativeCondition* createNegativeCondition(Condition* condition)
			                     throw(CSSException) = 0;

	virtual PositionalCondition* createPositionalCondition(int position,
								 bool typeNode,
			                     bool type)throw(CSSException) = 0;

	virtual AttributeCondition* createAttributeCondition(const string& localName,
								 const string* namespaceURI,
								 bool specified,
			                     const string& value)throw(CSSException) = 0;

	virtual LangCondition* createLangCondition(const string& lang)
	                         throw(CSSException) = 0;

	virtual AttributeCondition* createOneOfAttributeCondition(
			                      const string& localName,
								  const string* namespaceURI,
								  bool specified,
								  const string& value)throw(CSSException) = 0;

	virtual AttributeCondition* createBeginHyphenAttributeCondition(
								  const string& localName,
								  const string* namespaceURI,
			                      bool specified,
			                      const string& value)throw(CSSException) = 0;

	virtual AttributeCondition* createClassCondition(
			                      const string* namespaceURI,
								  const string& value)throw(CSSException) = 0;

	virtual AttributeCondition* createIdCondition(
								   const string& value)throw(CSSException) = 0;

	virtual AttributeCondition* createPseudoClassCondition(
			                      const string* namespaceURI,
							      const string& value)throw(CSSException) = 0;

	virtual Condition* createOnlyChildCondition()throw(CSSException) = 0;

	virtual Condition* createOnlyTypeCondition()throw(CSSException) = 0;

	virtual ContentCondition* createContentCondition(const string& data)
								throw(CSSException) = 0;

};

#endif /* ATTRIBUTECONDITION_H_ */
